$aliases
$aliases : array
Character set aliases (some of them from HTML5 spec.)
Character sets conversion functionality
$aliases : array
Character set aliases (some of them from HTML5 spec.)
$windows_codepages : array
Windows codepages
parse_charset(string $input) : string
Parse and validate charset name string.
Sometimes charset string is malformed, there are also charset aliases, but we need strict names for charset conversion (specially utf8 class)
string | $input | Input charset name |
The validated charset name
convert(string $str, string $from, string $to = null) : string
Convert a string from one charset to another.
string | $str | Input string |
string | $from | Suspected charset of the input string |
string | $to | Target charset to convert to; defaults to RCUBE_CHARSET |
Converted string
utf16_to_utf8(string $str) : string
Converts string from UTF-16 to UTF-8 (helper for utf-7 to utf-8 conversion)
string | $str | Input string |
The converted string
None found |
utf7imap_to_utf8(string $str) : string
Convert the data ($str) from RFC 2060's UTF-7 to UTF-8.
If input data is invalid, return the original input string. RFC 2060 obviously intends the encoding to be unique (see point 5 in section 5.1.3), so we reject any non-canonical form, such as &ACY- (instead of &-) or &AMA-&AMA- (instead of &AMAAwA-).
string | $str | Input string (UTF7-IMAP) |
Output string (UTF-8)
None found |
utf8_to_utf7imap(string $str) : string
Convert the data ($str) from UTF-8 to RFC 2060's UTF-7.
Unicode characters above U+FFFF are replaced by U+FFFE. If input data is invalid, return an empty string.
string | $str | Input string (UTF-8) |
Output string (UTF7-IMAP)
None found |
detect(string $string, string $failover = null, string $language = null) : string
A method to guess character set of a string.
string | $string | String |
string | $failover | Default result for failover |
string | $language | User language |
Charset name
None found |
clean(mixed $input) : mixed
Removes non-unicode characters from input.
If the input is an array, both values and keys will be cleaned up.
mixed | $input | String or array. |
String or array
None found |